import json
from src.common.logger import getLogger
from flask import Blueprint, Response, request
from src.modules.rag.service import advance_service

logger = getLogger()
api = Blueprint("advance", __name__)

@api.route("/retrieval/advance", methods=['POST'])
def retrieval_advance():
    form = request.form
    logger.info(f"retrieval_advance form: {form}")
    retrieve_docs = advance_service.invoke_retrieval_advance(form)
    return Response(json.dumps({ "code": 200, "data": retrieve_docs }), status = 200, mimetype = "application/json")
